package com.cne.gmail.Gmail.Excutor;



import com.cne.gmail.Gmail.model.MessageModel;
import com.cne.gmail.Gmail.service.BackendService;
import org.springframework.data.domain.Page;

import java.util.concurrent.Callable;

public class ThreadResponse implements Callable {

    private String emailAddress;
    private int currentPage;
    private int pageSize;
    private String label;
    private BackendService backendService;

    public ThreadResponse(String emailAddress, int currentPage,int pageSize,  String label, BackendService backendService){
      this.emailAddress=emailAddress;
      this.currentPage=currentPage;
      this.pageSize=pageSize;
      this.label=label;
      this.backendService=backendService;

    }


    @Override
    public Page<MessageModel> call()  {
          Page<MessageModel> all= backendService.selectMessagePage(currentPage,pageSize,emailAddress,label);
          return all;
    }
}
